package cn.hyman.consumer;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import javax.jms.Message;

@Component
public class MyQueueConsumer {
    @Value("${server.port}")
    private String port;

    @JmsListener(destination = "${myTopicName}")
    public void consumer(Message message) {
        System.out.println("消费者，监听器" + port + "收到消息：" + message.toString());
    }
}
